Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixex #4256: Obfuscate JDBC Password in query.log #4261

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Dec 4, 2024

Fixex #4256

To solve the related issue, we suggest the user to use these 2 parameters:

db.logs.query.obfuscate_literals=true
db.logs.query.parameter_logging_enabled=false

and he agrees with the tip.

In any case, even with these changes, we still need to handle some errors correctly.

Added a custom exception to obfuscate in logs and the returning RuntimeException,
since the connection string may contain the password.

Therefore, executing:

CALL apoc.load.jdbc("jdbc:notexistent://localhost:3306/data_mart?user=root&password=root","products")

the following exception (and log) will be returned:

java.sql.SQLException:
No suitable driver found for jdbc:notexistent://***

instead of the previous one:

java.sql.SQLException:
No suitable driver found for jdbc:notexistent://localhost:3306/data_mart?user=root&password=root

@RobertoSannino RobertoSannino merged commit 32192db into dev Dec 6, 2024
5 checks passed
@RobertoSannino RobertoSannino deleted the issue_4256 branch December 6, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants